package com.bugsnag.ohos;

import java.io.IOException;

/**
 * The severity of an Event, one of "error", "warning" or "info".
 * <p>
 * By default, unhandled exceptions will be Severity.ERROR and handled
 * exceptions sent with bugsnag.notify will be Severity.WARNING.
 *
 * @since 2021-07-01
 */
public enum Severity implements JsonStream.Streamable {
    /**
     * error
     */
    ERROR("error"),
    /**
     * warning
     */
    WARNING("warning"),
    /**
     * info
     */
    INFO("info");

    private String str;

    Severity(String str) {
        this.str = str;
    }

    @Override
    public void toStream(JsonStream writer) throws IOException {
        writer.value(str);
    }
}
